package com.sdx.console.question.service;

import java.util.List;

import org.beetl.sql.core.engine.PageQuery;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.sdx.console.question.dao.QaQuestionDao;
import com.sdx.console.question.entity.QaQuestion;
import com.ibeetl.admin.core.service.BaseService;

/**
 * question Service
 */

@Service
@Transactional
public class QaQuestionService extends BaseService<QaQuestion>{

    @Resource
	private QaQuestionDao questionDao;

    public PageQuery<QaQuestion>queryByCondition(PageQuery query){
        PageQuery ret =  questionDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelQaQuestion(List<String> ids){
        try {
            questionDao.batchDelQaQuestionByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除question失败", e);
        }
    }

	public List<QaQuestion> all() {
		return questionDao.all();
		}
}